/**
 * Created by yuming619 on 2016/10/21.
 */
//rem适配手机大小�
new function () {
    var _self = this;
    _self.width = 640;//�
    _self.fontSize = 100;//
    _self.widthProportion = function () {
        var p = (document.body && document.body.clientWidth || document.getElementsByTagName("html")[0].offsetWidth) / _self.width;
        return p > 1 ? 1 : p < 0.5 ? 0.5 : p;
    };
    _self.changePage = function () {
        document.getElementsByTagName("html")[0].setAttribute("style", "font-size:" + _self.widthProportion() * _self.fontSize + "px !important");
    }
    _self.changePage();
    window.addEventListener('resize', function () {
        _self.changePage();
    }, false);
};

   //输入密码框
function password(a, b, c) {
    var $input = $(a)
    $(b).on("input", function () {
        var pwd = $(this).val().trim();
        for (var i = 0, len = pwd.length; i < len; i++) {
            $input.eq("" + i + "").val(pwd[i]);
        }
        $input.each(function () {
            var index = $(this).index();
            if (index >= len) {
                $(this).val("");
            }
        });
        if (len == 6) {
            document.getElementById(c).removeAttribute("disabled");
            document.getElementById(c).style.backgroundColor = '#00a0e9';
            document.getElementById(c).style.cursor = "pointer";//执行其他操作
        }
        else {
            document.getElementById(c).setAttribute("disabled", "disabled");
            document.getElementById(c).style.backgroundColor = '#5bc0de';
            document.getElementById(c).style.cursor = "not-allowed";
        }
    });
}
